home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10935 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  51 lines

  1. Path: quadostimpy.natinst.com!user
  2. From: rcauvin@natinst.com (Roger L. Cauvin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Inheritance and function signatures
  5. Date: 11 Mar 1996 20:39:36 GMT
  6. Organization: National Instruments
  7. Message-ID: <rcauvin-1103961444450001@quadostimpy.natinst.com>
  8. References: <MANOWAR.96Mar11132010@dilo.engin.umich.edu> <31447542.6E69@cs.tu-berlin.de>
  9. NNTP-Posting-Host: quadostimpy.natinst.com
  10.  
  11. In article <31447542.6E69@cs.tu-berlin.de>, Roman Lechtchinsky
  12. <wolfro@cs.tu-berlin.de> wrote:
  13.  
  14. > Krisztian Flautner wrote:
  15. > > 
  16. > > It seems that function signitures are not properly inherited. Is this
  17. > > a bug or a feature ?
  18. > > 
  19. > A function defined in a derived class hides all inherited functions with the 
  20. > same name. It is defined this way in the April draft as well as in the 
  21. > original language. Use a qualifier to correct this problem: bb->A::print() ( 
  22. > and thank God it's not a virtual function ). A rather annoying rule, isn't 
  23. > it?
  24.  
  25. Or you can use an access declaration to make the base class functions
  26. visible in the derived class:
  27.  
  28. class Base
  29. {
  30.   public:
  31.     void Foo(void);
  32.     void Foo(int);
  33. };
  34.  
  35. class Derived : public Base
  36. {
  37.   public:
  38.     Base::Foo;  // Access declaration to make base class Foo visible.
  39.     void Foo(int, int);
  40. };
  41.  
  42. Roger
  43.  
  44. ---
  45.  
  46. Roger L. Cauvin
  47. rcauvin@natinst.com
  48. Software Engineer
  49. National Instruments
  50.